# try - except
try:
    num = int(input('请输入一个数字：'))
    num = 5 / num
    print(num)
except ValueError as e:
    print('请输入一个数字')
    print("原始报错信息", e)
except ZeroDivisionError:
    print("除数不能为0")
else:
    print("else - ")
finally:
    print("finally - ")


# raise 手动抛出
password = input("请输入8位以上密码：")
try:
    if len(password) < 8:
        raise Exception("密码长度不足8位，请重新输入")
except Exception as e:
    print(e)